home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 076-100 / disk_084 / ed / tools.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  3KB  |  116 lines

  1. static char    tools_h[] =
  2. "$Header: tools.h,v 2.1 85/11/14 11:30:00 beattie Exp $";
  3. /*
  4.  *    #defines for non-printing ASCII characters
  5.  */
  6.  
  7. #define NUL    0x00    /* ^@ */
  8. #define EOS    0x00    /* end of string */
  9. #define SOH    0x01    /* ^A */
  10. #define STX    0x02    /* ^B */
  11. #define ETX    0x03    /* ^C */
  12. #define EOT    0x04    /* ^D */
  13. #define ENQ    0x05    /* ^E */
  14. #define ACK    0x06    /* ^F */
  15. #define BEL    0x07    /* ^G */
  16. #define BS    0x08    /* ^H */
  17. #define HT    0x09    /* ^I */
  18. #define LF    0x0a    /* ^J */
  19. #define NL    '\n'
  20. #define VT    0x0b    /* ^K */
  21. #define FF    0x0c    /* ^L */
  22. #define CR    0x0d    /* ^M */
  23. #define SO    0x0e    /* ^N */
  24. #define SI    0x0f    /* ^O */
  25. #define DLE    0x10    /* ^P */
  26. #define DC1    0x11    /* ^Q */
  27. #define DC2    0x12    /* ^R */
  28. #define DC3    0x13    /* ^S */
  29. #define DC4    0x14    /* ^T */
  30. #define NAK    0x15    /* ^U */
  31. #define SYN    0x16    /* ^V */
  32. #define ETB    0x17    /* ^W */
  33. #define CAN    0x18    /* ^X */
  34. #define EM    0x19    /* ^Y */
  35. #define SUB    0x1a    /* ^Z */
  36. #define ESC    0x1b    /* ^[ */
  37. #define FS    0x1c    /* ^\ */
  38. #define GS    0x1d    /* ^] */
  39. #define RS    0x1e    /* ^^ */
  40. #define US    0x1f    /* ^_ */
  41. #define SP    0x20    /* space */
  42. #define DEL    0x7f    /* DEL*/
  43.  
  44.  
  45. #define TRUE    1
  46. #define FALSE    0
  47. #define ERR    -2
  48.  
  49.  
  50. /*    Definitions of meta-characters used in pattern matching
  51.  *    routines.  LITCHAR & NCCL are only used as token identifiers;
  52.  *    all the others are also both token identifier and actual symbol
  53.  *    used in the regular expression.
  54.  */
  55.  
  56.  
  57. #define BOL    '^'
  58. #define EOL    '$'
  59. #define ANY    '.'
  60. #define LITCHAR    'L'
  61. #define    ESCAPE    '\\'
  62. #define CCL    '['    /* Character class: [...] */
  63. #define CCLEND    ']'
  64. #define NEGATE    '~'
  65. #define NCCL    '!'    /* Negative character class [^...] */
  66. #define CLOSURE    '*'
  67. #define OR_SYM    '|'
  68. #define DITTO    '&'
  69.  
  70. /* Largest permitted size for an expanded character class.  (i.e. the class
  71.  * [a-z] will expand into 26 symbols; [a-z0-9] will expand into 36.)
  72.  */
  73. #define CLS_SIZE    128
  74.  
  75. /*
  76.  *    Tokens are used to hold pattern templates. (see makepat())
  77.  */
  78. typedef    char    BITMAP;
  79.  
  80. typedef struct token {
  81.     char        tok;
  82.     char        lchar;
  83.     BITMAP        *bitmap;
  84.     struct token    *next;
  85. } TOKEN;
  86.  
  87. #define TOKSIZE sizeof (TOKEN)
  88.  
  89. /*
  90.  *    An absolute maximun for strings.
  91.  */
  92.  
  93. #define MAXSTR    132    /* Maximum numbers of characters in a line */
  94.  
  95.  
  96. extern    char    *matchs();
  97. extern    char    *amatch();
  98. extern    char    *in_string();
  99. extern    TOKEN    *getpat();
  100. extern    int    esc();
  101. extern    char    *dodash();
  102. extern    TOKEN    *makepat();
  103. extern    int    unmakepat();
  104. extern    int    insert();
  105. extern    int    delete();
  106. extern    int    isalphanum();
  107. extern    char    *stoupper();
  108. extern    int    pr_tok();
  109. extern    int    pr_line();
  110. extern    BITMAP    *makebitmap();
  111.  
  112. /* macros */
  113. #define max(a,b)    ((a>b)?a:b)
  114. #define min(a,b)    ((a<b)?a:b)
  115. #define toupper(c)    (c>='a'&&c<='z'?c-32:c)
  116.